// var mock = require('mockjs')
import Mock from 'mockjs';
import utils from '../utils';
export default {
    getdevicelist () {
        Mock.mock('/getdevicelist', {
            // 20条数据
            "list|20": [{
                'id|+1': 1,
                "name": "@ctitle(10)",
                "price|30-500": 40,
                "count|1-100": 4,
            }]
        })
    },
    getdevicedetail () {
        Mock.mock('/getdevicedetail/1', {
            // 20条数据
            "list|20": [{
                'id|+1': 1,
                "name": "@ctitle(10)",
                "price|30-500": 40,
                "count|1-100": 4,
            }]
        })
    },
    addDevice () {
        Mock.mock('/addDevice', {
            // 20条数据
            "body": {
                'code': 200
            }
        })
    },
    doLogin () {
        Mock.mock('/doLogin','post', ({body}) => {
            var data = utils.search2obj(body)
            return {
                // 20条数据
                'code': 200,
                "body": data
            }
        })
    },
}